package com.jiuyou.storeController.technician;

import com.jiuyou.storeController.common.StoreBaseController;
import com.ruoyi.common.constant.DicConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.teaching.domain.PlatformTeaching;
import com.ruoyi.teaching.service.IPlatformTeachingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.DataInput;
import java.util.List;

/**
 * @Author: chengliang
 * @Date: Created in 2022/2/9
 */
@RestController
@RequestMapping("/store/teaching")
public class TeachingStoreController extends StoreBaseController {
    @Autowired
    private IPlatformTeachingService service;

    @PostMapping
    public TableDataInfo getList(){
        startPage();
        PlatformTeaching platformTeaching = new PlatformTeaching();
        platformTeaching.setState(DicConstants.SYS_Y.getCode());
        List<PlatformTeaching> platformTeachings = service.selectPlatformTeachingList(platformTeaching);
        return getDataTable(platformTeachings);
    }
    @PostMapping("/getOne/{id}")
    public AjaxResult getOne(@PathVariable Long id){
        return AjaxResult.success(service.selectPlatformTeachingById(id));
    }
}
